﻿#pragma once

#include "df.h"


namespace df
{


	struct ErrCode
	{

		enum{
			_Start = 65534,

			UnknowLastError,


			SynatxError,
			IllegalNull,
			StackOverflow,
			OpenNullFile,
			FileTooBig,
			NetInvalid,
			HttpHeadInvalid,
			HttpContentInvalid,
			compressError,
			uncompressError,
			manualStop,
			fileError,
			serverError,

			_End
		};




		static df::CC GetCodeMsg(uint32_t code)
		{
			static df::CC CodeMsg[] = {
				tcc_("迷之LastError"),


				tcc_("语法错误"),
				tcc_("非法null参数"),
				tcc_("stack overflow"),
				tcc_("文件路径无效"),
				tcc_("文件过大"),
				tcc_("网络无效"),
				tcc_("http头无效"),
				tcc_("http content无效"),
				tcc_("压缩失败"),
				tcc_("解压失败"),
				tcc_("手动终止回调"),
				tcc_("文件错误"),
				tcc_("服务器处理失败"),
			};


			if (code > _Start && code < _End)
				return CodeMsg[code - _Start - 1];

			return tcc_("");
		}
	};


}
